class Storage {
  constructor() {
      if (!window || !window.localStorage) {
          throw new Error('localstorage不可用！');
      }
  }

  /**
   * 获取session
   */
  getSession() {
      return window.localStorage.getItem('__session__');
  }

  /**
   * 设置session
   */
  setSession(session) {
      return window.localStorage.setItem('__session__', session);
  }

  removeSession() {
    return window.localStorage.removeItem('__session__');
  }

}

export default new Storage(); 